<p class="title">Registering fonts</p>
<p>In the <code>style</code> attribute of the <code>body</code> tag of <a href="http://tutorial.itextpdf.com/src/main/resources/html/thoreau.html">thoreau.html</a>, we've told the HTML renderer that we prefer the font <em>Nimbus Roman No9 L</em> (a font you can usually find on Linux distributions).
If that font can't be found, we want the font to be <em>Times New Roman</em> (a font that is usually distributed with Windows).
If that font isn't found, the default font can be used (which is what happened in <a href="http://tutorial.itextpdf.com/results/xmlworker/thoreau0.pdf">thoreau0.pdf</a>).</p>
<p>XML Worker uses the <code>FontFactory</code> class to retrieve fonts. Initially, this class is only aware of the <em>standard Type 1 fonts</em>.
If we want iText to find <em>Nimbus Roman No9 L</em> or <em>Times New Roman</em>, we need to register these fonts (see section 11.4.1 of <a href="http://itextpdf.com/book/">iText in Action &#151; Second Edition</a>).
In this example, we just register the "usual suspects":</p>
<pre code="java">FontFactory.registerDirectories();

</pre>
<p>On Windows, this method will find the font files <i>times.ttf</i>, <i>timesbd.ttf</i>, <i>timesbi.ttf</i>, and <i>timesi.ttf</i>. iText will use fonts these to render all the text in the HTML.
On Linux, iText will use the Type1 font stored in <i>n021004l.afm</i>/<i>n021004l.pfb</i> and use it whenever a regular font is needed. Unfortunately, it will be more difficult to find the corresponding <i>bold</i>, <i>italic</i> and <i>bold italic</i> font. Choose your font wisely if you want to avoid this problem.</p>